﻿using System;
using System.IO;
using System.Security;

class PrintOddLinesOfFile
{
    static void Main()
    {
        try
        {
            using (StreamReader readFile = new StreamReader("C:\\WINDOWS\\win.ini"))
            {
                int counter = 1;
                string currentLine;

                while((currentLine = readFile.ReadLine()) != null)
                {
                    if (counter % 2 == 1)
                    {
                        Console.WriteLine(currentLine);
                    }
                    counter++;
                }
            }
        }
        catch (FileNotFoundException)
        {
            Console.WriteLine("Cannot find this file");
        }
        catch (DirectoryNotFoundException)
        {
            Console.WriteLine("Invalid Folder ");
        }
        catch (PathTooLongException)
        {
            Console.WriteLine("The path is too long");
        }
        catch (UnauthorizedAccessException)
        {
            Console.WriteLine("You don`t have access!");
        }
        catch (NotSupportedException)
        {
            Console.WriteLine("Cannot open this file!");
        }
        catch (SecurityException)
        {
            Console.WriteLine("Not enough permission to open file!");
        }
    }
}